package com.ruoyi.audit.controller;

import com.ruoyi.audit.entity.dto.RoleCenter;
import com.ruoyi.audit.service.RoleCenterService;
import com.ruoyi.audit.utils.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/AuthorityRole")
public class AuthorityRoleController {

    @Resource
    RoleCenterService roleCenterService;

    /**
     * 分配权限
     * @param roleCenter
     * @param authorityId
     * @return
     */
    @RequestMapping("/insertByAuthorityId")
    public Result insertByAuthorityId(@RequestBody RoleCenter roleCenter, @RequestParam Integer authorityId){
        return roleCenterService.insertByAuthorityId(roleCenter,authorityId);
    }


}
